package physics;

import entity.Entity;

/**
 * @author Greg Giannone
 * 
 * This class is used to detect collisions between entities
 */

public class Collision 
{
	/**
	 * @param e1
	 * @param e2
	 * @return true if the distance between e1 and e2 is 
	 * 				less than their combined radii
	 */
	public static boolean haveCollided(Entity e1, Entity e2)
	{
		double dist = e1.getPosition().distance(e2.getPosition());
		return dist < e1.getRadius() + e2.getRadius();
	}
}
